package com.rop.znyx.home.controller;

import com.rop.znyx.common.result.Result;
import com.rop.znyx.model.product.Category;
import com.rop.znyx.product.ProductFeignClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

/**
 * Created with IntelliJ IDEA
 * User: Rop
 * Date: 2023/7/20
 * Time: 14:10
 * Description:
 */

@Api(tags = "商品分类")
@RestController
@RequestMapping("api/home")
@RequiredArgsConstructor
public class CategoryApiController {

    private final ProductFeignClient productFeignClient;

    @ApiOperation(value = "获取分类信息")
    @GetMapping("category")
    public Result<List<Category>> index() {
        return productFeignClient.findAllCategoryList();
    }
}
